
<!-- Box -->
<div class="box">
    <!-- Box Head -->
    <div class="box-head">
        <h2>View purchase</h2>
    </div>
    <!-- End Box Head -->

    <!-- Form -->
    <div class="form">
        <p>
            <label class="bold">CONTACT DETAIL</label>
        </p>
        <p>
            <label>First Name</label>
            <input type="text" class="field size1" name="first_name" value="<?php echo $purchase->first_name; ?>" disabled/>
            <input type="hidden" class="field size1" name="id" value="<?php echo $purchase->id; ?>"/>
        </p>
        <p>
            <label>Last Name</label>
            <input type="text" class="field size1" name="last_name" value="<?php echo $purchase->last_name; ?>" disabled/>
        </p>
        <p>
            <label>Address</label>
            <textarea class="field size1" rows="10" cols="30" name="address" disabled><?php echo $purchase->address;?></textarea>
        </p>
        <p>
            <label>City</label>
            <input type="text" class="field size1" name="city" value="<?php echo $purchase->city; ?>" disabled/>
        </p>
        <p>
            <label>State</label>
            <input type="text" class="field size1" name="state" value="<?php echo $purchase->state; ?>" disabled/>
        </p>
        <p>
            <label>Country</label>
            <input type="text" class="field size1" name="country" value="<?php echo $purchase->country; ?>" disabled/>
        </p>
        <p>
            <label>Postal Code</label>
            <input type="text" class="field size1" name="postal" value="<?php echo $purchase->postal; ?>" disabled/>
        </p>
        <p>
            <label>Phone</label>
            <input type="text" class="field size1" name="phone" value="<?php echo $purchase->phone; ?>" disabled/>
        </p>
        <p>
            <label>Email</label>
            <input type="text" class="field size1" name="email" value="<?php echo $purchase->email; ?>" disabled/>
        </p>
        <p>
            <label>Additional Information</label>
            <textarea class="field size1" rows="10" cols="30" name="additional" disabled><?php echo $purchase->additional;?></textarea>
        </p>
        <p>
            <label class="bold">SHIPPING ADDRESS</label>
        </p>
        <p>
            <label>First Name</label>
            <input type="text" class="field size1" name="first_name_s" value="<?php echo $purchase->first_name_s; ?>" disabled/>
        </p>
        <p>
            <label>Last Name</label>
            <input type="text" class="field size1" name="last_name_s" value="<?php echo $purchase->last_name_s; ?>" disabled/>
        </p>
        <p>
            <label>Address</label>
            <textarea class="field size1" rows="10" cols="30" name="address_s" disabled><?php echo $purchase->address_s;?></textarea>
        </p>
        <p>
            <label>City</label>
            <input type="text" class="field size1" name="city_s" value="<?php echo $purchase->city_s; ?>" disabled/>
        </p>
        <p>
            <label>State</label>
            <input type="text" class="field size1" name="state_s" value="<?php echo $purchase->state_s; ?>" disabled/>
        </p>
        <p>
            <label>Country</label>
            <input type="text" class="field size1" name="country_s" value="<?php echo $purchase->country_s; ?>" disabled/>
        </p>
        <p>
            <label>Postal Code</label>
            <input type="text" class="field size1" name="postal_s" value="<?php echo $purchase->postal_s; ?>" disabled/>
        </p>
        <p>
            <label class="bold">PURCHASE ITEM</label>
        </p>
        <div class="table">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <th>ID</th>
                    <th>Item</th>
                    <th>Qty</th>
                    <th>@ Price</th>
                    <th>Total Price</th>
                </tr>
                <?php $i = 0;$total=0; ?>
                <?php foreach ($purchase_item->result() as $p): ?>
                    <tr <?php echo (($i++ % 2) != 0) ? 'class="odd"' : ''; ?>>
                        <td><?php echo $p->id;?></td>
                        <td><?php echo $p->name;?></td>
                        <td><?php echo $p->quantity;?></td>
                        <td><?php echo $p->price;?></td>
                        <td><?php echo $p->price*$p->quantity;?></td>
                        <?php $total += $p->price*$p->quantity;?>
                    </tr>
                <?php endforeach; ?>
                    <tr>
                        <td colspan="3"></td>
                        <td class="bold">TOTAL</td>
                        <td><?php echo $total;?></td>
                    </tr>
            </table>

        </div>
        <div class="_blank" style="height: 40px;">
            
        </div>
    </div>
</div>
<!-- End Box -->